<!Doctype html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<title>Python 教程 的搜索結果</title>

  <meta name='robots' content='noindex, follow, max-image-preview:large' />
<meta name="keywords" content="Python 教程">
<meta name="description" content="菜鸟教程: Python 教程 的搜索結果..">
		
	<link rel="shortcut icon" href="https://static.jyshare.com/images/favicon.ico">
	<link rel="stylesheet" href="/wp-content/themes/runoob/style.css?v=1.181" type="text/css" media="all" />
<link rel="stylesheet" href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/font-awesome/4.7.0/css/font-awesome.min.css" media="all" />	
  <!--[if gte IE 9]><!-->
  <script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/2.0.3/jquery.min.js"></script>
  <!--<![endif]-->
  <!--[if lt IE 9]>
     <script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/1.9.1/jquery.min.js"></script>
     <script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/html5shiv/r29/html5.min.js"></script>
  <![endif]-->
  <link rel="apple-touch-icon" href="https://static.jyshare.com/images/icon/mobile-icon.png"/>
  <meta name="apple-mobile-web-app-title" content="菜鸟教程">
</head>
<body>

<!--  头部 -->
<div class="container logo-search">

  <div class="col search row-search-mobile">
    <form action="index.php">
      <input class="placeholder" placeholder="搜索……" name="s" autocomplete="off">
      
    </form>
  </div>

  <div class="row">
    <div class="col logo">
      <h1><a href="/">菜鸟教程 -- 学的不仅是技术，更是梦想！</a></h1>
    </div>
        
    <div class="col search search-desktop last">
      <div class="search-input" >
      <form action="//www.runoob.com/" target="_blank">
        <input class="placeholder" id="s" name="s" placeholder="搜索……"  autocomplete="off" style="height: 44px;">
      </form>
      
      </div>
    </div>
  </div>
</div>




<!-- 导航栏 -->
<!-- 导航栏 -->
<div class="container navigation">
	<div class="row">
		<div class="col nav">
			<ul class="pc-nav" id="runoob-detail-nav">
				<li><a href="//www.runoob.com/">首页</a></li>
				<li><a href="/html/html-tutorial.html">HTML</a></li>
				<li><a href="/css/css-tutorial.html">CSS</a></li>
				<li><a href="/js/js-tutorial.html">JavaScript</a></li>
				<li><a href="javascript:void(0);" data-id="vue">Vue</a></li>
				<li><a href="javascript:void(0);" data-id="bootstrap">Bootstrap</a></li>
				<li><a href="/nodejs/nodejs-tutorial.html">NodeJS</a></li>
				<li><a href="/python3/python3-tutorial.html">Python3</a></li>
				<li><a href="/python/python-tutorial.html">Python2</a></li>
				<li><a href="/java/java-tutorial.html">Java</a></li>
				<li><a href="/cprogramming/c-tutorial.html">C</a></li>
				<li><a href="/cplusplus/cpp-tutorial.html">C++</a></li>
				<li><a href="/csharp/csharp-tutorial.html">C#</a></li>
				<li><a href="/go/go-tutorial.html">Go</a></li>
				<li><a href="/sql/sql-tutorial.html">SQL</a></li>
				<li><a href="/linux/linux-tutorial.html">Linux</a></li>
				<li><a href="/jquery/jquery-tutorial.html">jQuery</a></li>
				<li><a href="/browser-history">本地书签</a></li><!--
				<li><a href="https://www.jyshare.com/front-end/9235/" target="_blank">AI 编程助理</a></li>	-->
				<!--
			
				<li><a href="/w3cnote/knowledge-start.html" style="font-weight: bold;" onclick="_hmt.push(['_trackEvent', '星球', 'click', 'start'])" title="我的圈子">我的圈子</a></li>				
				<li><a href="javascript:;" class="runoob-pop">登录</a></li>
				-->
      		</ul>
			<ul class="mobile-nav">
				<li><a href="//www.runoob.com/">首页</a></li>
				<li><a href="/html/html-tutorial.html">HTML</a></li>
				<li><a href="/css/css-tutorial.html">CSS</a></li>
				<li><a href="/js/js-tutorial.html">JS</a></li>
				<li><a href="/browser-history">本地书签</a></li>
				<li><a href="javascript:void(0)" class="search-reveal">Search</a> </li>
			</ul>
			
		</div>
	</div>
</div>

<div class="container sub-navigation sub-navigation-articles" style="display:none">
	<div class="row">
		<div class="col nav-sub">
		<ul id="python">
			<li class="cat-item"><a href="/python3/python3-tutorial.html">Python3 教程 <i class="fa fa-external-link" aria-hidden="true"></i></a></li>
			<li class="cat-item"><a href="/python/python-tutorial.html">Python2 教程 <i class="fa fa-external-link" aria-hidden="true"></i></a></li>
		</ul>
		<ul id="vue">
			<li class="cat-item"><a href="/vue3/vue3-tutorial.html">Vue3 教程 <i class="fa fa-external-link" aria-hidden="true"></i></a></li>
			<li class="cat-item"><a href="/vue/vue-tutorial.html">vue2 教程 <i class="fa fa-external-link" aria-hidden="true"></i></a></li>
		</ul>

		<ul id="bootstrap">
			<li class="cat-item"><a href="/bootstrap/bootstrap-tutorial.html">Bootstrap3 教程 <i class="fa fa-external-link" aria-hidden="true"></i></a></li>
			<li class="cat-item"><a href="/bootstrap4/bootstrap4-tutorial.html">Bootstrap4 教程 <i class="fa fa-external-link" aria-hidden="true"></i></a></li>
			<li class="cat-item"><a href="/bootstrap5/bootstrap5-tutorial.html">Bootstrap5 教程 <i class="fa fa-external-link" aria-hidden="true"></i></a></li>
			<li class="cat-item"><a href="/bootstrap/bootstrap-v2-tutorial.html">Bootstrap2 教程 <i class="fa fa-external-link" aria-hidden="true"></i></a></li>
		</ul>
		</div>
	</div>
</div><!--  内容  -->
<style>
em{
	color:#c00;
}
ol {
	list-style-type: decimal;
    margin: 20px;
    padding: 0;
}
.loading-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	display:none;
}

.loading-spinner {
	border: 8px solid rgba(0, 0, 0, 0.1);
	border-top: 8px solid #64854c;
	border-radius: 50%;
	width: 30px;
	height: 30px;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.loading-text {
	margin-top: 10px;
	font-size: 14px;
	color: #555;
}

.AIButton {
      display: inline-block;
      padding: 10px 20px;
      font-size: 16px;
      text-align: center;
      text-decoration: none;
      cursor: pointer;
      border: 2px solid #96b97d;
      border-radius: 5px;
      color: #96b97d;
      background-color: #ffffff;
      transition: background-color 0.3s, color 0.3s;
    }

    /* 鼠标悬停时的按钮样式 */
    .AIButton:hover {
      background-color: #96b97d;
      color: #ffffff;
    }
</style>

<div class="container main">
	<div class="row">		
		<div class="col middle-column big-middle-column">
			<div class="archive-options" style="display:block;">
		
			<div class="wrapper">
			<div class="search-input">
				<form action="/" id="runnob-search-form">
				<input placeholder="搜索.."  value="Python 教程" type="text" id="runnob-search-input" name="s" autocomplete="off">
			
				<div class="icon"><i class="fa fa-search" aria-hidden="true"></i></div>
				</form>
			</div>
			</div>
			
			</div>
			
			<div class="archive-list">
			<!-- ad start-->
						<div class="archive-list-item"><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5751451760833794"
						crossorigin="anonymous"></script>
				<ins class="adsbygoogle"
						style="display:block"
						data-ad-format="fluid"
						data-ad-layout-key="-ha-b+1l-3j+4p"
						data-ad-client="ca-pub-5751451760833794"
						data-ad-slot="1838418016"></ins>
				<script>
						(adsbygoogle = window.adsbygoogle || []).push({});
				</script></div>
				            <!-- ad end-->
							

					<div class="archive-list-item">
						<div class="post-intro" style="width: 100%">
							<h2><a target="_blank" href="http://www.runoob.com/python/python-tutorial.html" rel="bookmark" title=" <em>Python</em> 基础<em>教程</em>" onclick="push_runoob_search(4008)"> 
							<em>Python</em> 基础<em>教程</em>							</a> <i class="fa fa-external-link"></i></h2>
							<p>
							Python 基础教程 Python 是一种解释型、面向对象、动态数据类型的高级程序设计语言。Python 由 Guido van Rossum 于 1989 年底发明，第一个公开发行版发行于 1991 年。像 Perl 语言一样,Python 源代码同样遵循 GP...							</p>
						</div>
					</div>
					  			

					<div class="archive-list-item">
						<div class="post-intro" style="width: 100%">
							<h2><a target="_blank" href="http://www.runoob.com/python3/python3-tutorial.html" rel="bookmark" title=" <em>Python</em>3 <em>教程</em>" onclick="push_runoob_search(7279)"> 
							<em>Python</em>3 <em>教程</em>							</a> <i class="fa fa-external-link"></i></h2>
							<p>
							Python 3 教程 Python 的 3.0 版本，常被称为 Python 3000，或简称 Py3k。相对于 Python 的早期版本，这是一个较大的升级。为了不带入过多的累赘，Python 3.0 在设计的时候没有考虑向下兼容。Python 介绍及安装教...							</p>
						</div>
					</div>
					  			

					<div class="archive-list-item">
						<div class="post-intro" style="width: 100%">
							<h2><a target="_blank" href="http://www.runoob.com/python3/python-urllib.html" rel="bookmark" title=" <em>Python</em> urllib" onclick="push_runoob_search(23611)"> 
							<em>Python</em> urllib							</a> <i class="fa fa-external-link"></i></h2>
							<p>
							'https://www.runoob.com/?s=' # 菜鸟教程搜索页面 keyword='<em color="red">Python 教程</em>' key_code= urllib.request.quote(keyword)#对请求进行编码 url_all=url+key_code header={ 'User-Agent':'Mozilla/5.0(X11;Fedora;Linux...							</p>
						</div>
					</div>
					  			

					<div class="archive-list-item">
						<div class="post-intro" style="width: 100%">
							<h2><a target="_blank" href="http://www.runoob.com/w3cnote/python-ten-minute-introductory-tutorial.html" rel="bookmark" title=" <em>Python</em>十分钟入门" onclick="push_runoob_search(11154)"> 
							<em>Python</em>十分钟入门							</a> <i class="fa fa-external-link"></i></h2>
							<p>
							简介 Python是一种动态解释型的编程语言。Python可以在Windows、UNIX、MAC等多种操作系统上使用，也可以在Java、.NET开发平台上使用。特点 1 Python使用C语言开发，但是Python不再有C语言中的指针等复杂的...prin...							</p>
						</div>
					</div>
					  			

					<div class="archive-list-item">
						<div class="post-intro" style="width: 100%">
							<h2><a target="_blank" href="http://www.runoob.com/python/python-exceptions.html" rel="bookmark" title=" <em>Python</em> 异常处理" onclick="push_runoob_search(4532)"> 
							<em>Python</em> 异常处理							</a> <i class="fa fa-external-link"></i></h2>
							<p>
							异常处理:本站Python教程会具体介绍。断言(Assertions):本站Python教程会具体介绍。python标准异常 异常名称 描述 BaseException 所有异常的基类 SystemExit解释器请求退出 KeyboardInterrupt 用户中断执行(通常...							</p>
						</div>
					</div>
					  			

					<div class="archive-list-item">
						<div class="post-intro" style="width: 100%">
							<h2><a target="_blank" href="http://www.runoob.com/w3cnote/keyword-manual.html" rel="bookmark" title=" 菜鸟<em>教程</em>关键字手册" onclick="push_runoob_search(12983)"> 
							菜鸟<em>教程</em>关键字手册							</a> <i class="fa fa-external-link"></i></h2>
							<p>
							python、py <em color="red">Python 教程</em> ios iOS 教程 	swift 	Swift 教程 json JSON 教程 jquery、jq jQuery 教程 jQuery UI 教程 rss RSS 教程 xml XML 教程 mongo MongoDB 教程 正则、regex 正则表达式教程 easyui jQuery Eas...							</p>
						</div>
					</div>
					  			

					<div class="archive-list-item">
						<div class="post-intro" style="width: 100%">
							<h2><a target="_blank" href="http://www.runoob.com/python3/python-requests.html" rel="bookmark" title=" <em>Python</em> requests 模块" onclick="push_runoob_search(24589)"> 
							<em>Python</em> requests 模块							</a> <i class="fa fa-external-link"></i></h2>
							<p>
							{'s':'python 教程'}#设置请求头 headers={"User-Agent":"Mozilla/5.0(Windows NT 10.0;Win64;x64)AppleWebKit/537.36(KHTML,like Gecko)Chrome/54.0.2840.99 Safari/537.36"}#params 接收一个字典或者字符串的查...							</p>
						</div>
					</div>
					  			

					<div class="archive-list-item">
						<div class="post-intro" style="width: 100%">
							<h2><a target="_blank" href="http://www.runoob.com/python3/python-mongodb.html" rel="bookmark" title=" <em>Python</em> MongoDB" onclick="push_runoob_search(20150)"> 
							<em>Python</em> MongoDB							</a> <i class="fa fa-external-link"></i></h2>
							<p>
							数据库安装与介绍可以查看我们的MongoDB 教程。PyMongo Python 要连接 MongoDB 需要 MongoDB 驱动，这里我们使用 PyMongo 驱动来连接。pip 安装 pip 是一个通用的 Python 包管理工具，提供了对 Python 包的查找、...							</p>
						</div>
					</div>
					  			

					<div class="archive-list-item">
						<div class="post-intro" style="width: 100%">
							<h2><a target="_blank" href="http://www.runoob.com/python/python-json.html" rel="bookmark" title=" <em>Python</em> JSON" onclick="push_runoob_search(9866)"> 
							<em>Python</em> JSON							</a> <i class="fa fa-external-link"></i></h2>
							<p>
							本教程我们会下载 Demjson 并安装：$tar xvzf demjson-2.2.3.tar.gz$cd demjson-2.2.3$python setup.py install 更多安装介绍查看：http://deron.meranda.us/python/demjson/install JSON函数 函数描述 encode 将...							</p>
						</div>
					</div>
					  			

					<div class="archive-list-item">
						<div class="post-intro" style="width: 100%">
							<h2><a target="_blank" href="http://www.runoob.com/python3/python3-resources.html" rel="bookmark" title=" <em>Python</em> 有用的资源" onclick="push_runoob_search(24796)"> 
							<em>Python</em> 有用的资源							</a> <i class="fa fa-external-link"></i></h2>
							<p>
							Python 有用的资源 以下资源包含了 Python 有关的网站、书籍和文章。相关网站 Python 3.6.3 中文手册 Python3 最新文档 Python 2.X 版本的教程 Python 算法学习 相关书籍： 父与子的编程之旅 Python 学习手册 Pyt...							</p>
						</div>
					</div>
					  <div class="archive-list-item"><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5751451760833794"
				crossorigin="anonymous"></script>
		   <ins class="adsbygoogle"
				style="display:block"
				data-ad-format="fluid"
				data-ad-layout-key="-ha-b+1l-3j+4p"
				data-ad-client="ca-pub-5751451760833794"
				data-ad-slot="1838418016"></ins>
		   <script>
				(adsbygoogle = window.adsbygoogle || []).push({});
		   </script></div>			</div>
		<div class="article">
			<div class="archive-list-item">
				<div id="wp_page_numbers">
				<ul>
				<li><span>1</span></li><li><a href='/?s=Python%20%E6%95%99%E7%A8%8B&amp;page=2'>2</a></li><li><a href='/?s=Python%20%E6%95%99%E7%A8%8B&amp;page=3'>3</a></li><li><a href='/?s=Python%20%E6%95%99%E7%A8%8B&amp;page=4'>4</a></li><li><a href='/?s=Python%20%E6%95%99%E7%A8%8B&amp;page=5'>5</a></li><li><a href='/?s=Python%20%E6%95%99%E7%A8%8B&amp;page=6'>6</a></li><li><a href='/?s=Python%20%E6%95%99%E7%A8%8B&amp;page=7'>7</a></li><li><a href='/?s=Python%20%E6%95%99%E7%A8%8B&amp;page=8'>8</a></li><li><a href='/?s=Python%20%E6%95%99%E7%A8%8B&amp;page=9'>9</a></li><li><a href='/?s=Python%20%E6%95%99%E7%A8%8B&amp;page=10'>10</a></li><li><a href='/?s=Python%20%E6%95%99%E7%A8%8B&amp;page=2' class="btn_page"><label>下一页</label><b>&gt;</b></a></li>				</ul>
				<div style="float: none; clear: both;"></div>
				</div>
			</div>
		</div>

</div>
	
	  <!-- AI搜索start -->
	<div class="listcol last right-column">
		<div class="sidebar-box cate-list">
			<div class="sidebar-box recommend-here list-link">
				<a href="javascript:void(0);" style="font-size: 16px; color:#64854c;font-weight:bold;">
				<i class="fa fa-cube" aria-hidden="true"></i> AI 提供的内容
				</a>
			</div>
			<div class="cate-items" id="responseContainer" style="font-size: 14px;text-align: left;padding-right: 10px;color: #6c757d; font-weight: bold;"> 
			
			<button id="getAI" class="AIButton">请求 AI 帮忙</button>
				<div class="loading-container">
				<div class="loading-spinner"></div>
				<div class="loading-text">AI 思考中...</div>
				</div>
			</div>
		</div>
		
	 <!-- AI 搜索end -->
	 <!-- 热门搜索start -->
	
		<div class="sidebar-box cate-list">
			<div class="sidebar-box recommend-here list-link">
				<a href="javascript:void(0);" style="font-size: 16px; color:#64854c;font-weight:bold;">
				<i class="fa fa-hashtag" aria-hidden="true"></i> 热门搜索
				</a>
			</div>
			<div class="cate-items" id="hot-search-items"> 
			
			</div>
		</div>
	
	 <!-- 热门搜索end -->

	  <!-- 推广start -->
	
		<div class="sidebar-box cate-list">
			<div class="sidebar-box recommend-here">
				<a href="javascript:void(0);">
				Advertisement
				</a>
			</div>
			<div class="cate-items"> 
			<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5751451760833794"
				crossorigin="anonymous"></script>
			<!-- 移动版 自动调整 -->
			<ins class="adsbygoogle"
				style="display:block"
				data-ad-client="ca-pub-5751451760833794"
				data-ad-slot="1691338467"
				data-ad-format="auto"
				data-full-width-responsive="true"></ins>
			<script>
				(adsbygoogle = window.adsbygoogle || []).push({});
			</script>
			</div>
		</div>
	</div>
	 <!-- 推广end -->

</div>
</div>

<script>
function autocomplete(inp, arr) {
  var currentFocus;
  inp.addEventListener("input", function(e) {
      var a, b, i, val = this.value;
      closeAllLists();
      if (!val) { return false;}
      currentFocus = -1;
      a = document.createElement("DIV");
      a.setAttribute("id", this.id + "autocomplete-list");
      a.setAttribute("class", "autocomplete-items");
      this.parentNode.appendChild(a);
      a.style.display="none";
      for (i = 0; i < arr.length; i++) {
        if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {
          b = document.createElement("DIV");
          b.innerHTML = "<strong>" + arr[i].substr(0, val.length) + "</strong>";
          b.innerHTML += arr[i].substr(val.length);
          b.innerHTML += "<input type='hidden' value='" + arr[i] + "'>";
          b.addEventListener("click", function(e) {
              inp.value = this.getElementsByTagName("input")[0].value;
              closeAllLists();
              $("#runnob-search-form").submit();
          });
          a.appendChild(b);
          a.style.display="block";
          
        }
      }
  });

  inp.addEventListener("keydown", function(e) {
      var x = document.getElementById(this.id + "autocomplete-list");
      if (x) x = x.getElementsByTagName("div");
      if (e.keyCode == 40) {
        currentFocus++;
        addActive(x);
      } else if (e.keyCode == 38) {
        currentFocus--;
        addActive(x);
      } else if (e.keyCode == 13) {
		    $("#runnob-search-form").submit();
        e.preventDefault();
        if (currentFocus > -1) {
          if (x) x[currentFocus].click();
        }
      }
  });
  function addActive(x) {
    if (!x) return false;
    removeActive(x);
    if (currentFocus >= x.length) currentFocus = 0;
    if (currentFocus < 0) currentFocus = (x.length - 1);
    x[currentFocus].classList.add("autocomplete-active");
  }
  function removeActive(x) {
    for (var i = 0; i < x.length; i++) {
      x[i].classList.remove("autocomplete-active");
    }
  }
  function closeAllLists(elmnt) {
    var x = document.getElementsByClassName("autocomplete-items");
    for (var i = 0; i < x.length; i++) {
      if (elmnt != x[i] && elmnt != inp) {
        x[i].parentNode.removeChild(x[i]);
      }
    }
  }
  document.addEventListener("click", function (e) {
      closeAllLists(e.target);
  });
}
var suggestions = []
$(function() {
	$( "#runnob-search-input" ).keyup(function(e) {
		runnob_suggest = $("#runnob-search-input").val();
		if(runnob_suggest) {
			$.get("https://www.runoob.com/wp-content/themes/runoob/option/alisearch/v330/suggest.php?q="+runnob_suggest,function(data,status){
				$.each(data, function(i, item) {
					suggestions[i] = data[i].suggestion;
				});
			});
		}
		
	});
	$(".fa-search").click(function() {
		$("#runnob-search-form").submit();
	})
	$('html, body').animate({
        scrollTop: $(".navigation").offset().top
    }, 200);
	if(readCookie("runoob-uuid")) {
	    userID = readCookie("runoob-uuid");
	}
	
	$.getJSON("https://www.runoob.com/wp-content/themes/runoob/option/alisearch/v330/hot_hint.php?user_id=" + userID,function(data){
		var hot_html = '';
		let containSpecial = RegExp(/[(\ )(\~)(\~)(\!)(\！)(\@)(\#)(\$)(\￥)(\%)(\^)(\……)(\&)(\*)(\()(\（)(\))(\）(\——)(\=)(\[)(\【)(\])(\】)(\{)(\})(\|))(\、))(\)(\\)(\;)(\；)(\:)(\：)(\')(\‘)(\’)(\")(\“)(\”)(\,)(\，)(\。)(\/)(\《)(\》)(\?)(\？)(\)]+/);
			
		$.each( data, function( key, val ) {
			if($.isNumeric(val['hot']))  {
				return;
			}
			if (containSpecial.test(val['hot'])) {
				return;
			}

			hot_html += '<a target="_top"  href="https://www.runoob.com/?s='+ val['hot'] + '">' + val['hot']+ '</a>';
		});
		$("#hot-search-items").html(hot_html);
	});
	// AI
	var loadingText = 'AI 正在思考中。。。';
	var inputText = "Python+%E6%95%99%E7%A8%8B";
	var requestToken =  "1213a462757a46a873d997ce6d50f8a3";
//	$('#responseContainer').html(loadingText);

	// 在非移动端执行的代码
	//console.log("非移动端访问");
	$("#getAI").click(function(event) {
		// 阻止默认行为，即阻止跳转
		//event.preventDefault();
		$(this).hide();
		$(".loading-container").show(1000, function(){
		
			const url = "https://www.jyshare.com/more/ai/stream_search2.php?userInput=" + inputText + '&requestToken=' + requestToken + '&ptype=search';;
			const eventSource = new EventSource(url);

			eventSource.addEventListener("open", (event) => {
				 //console.log("连接已建立");
			});

			eventSource.addEventListener("message", (event) => {
				try {
					var result = JSON.parse(event.data);
				//	console.log(result.Success);
					if(result.output ){
						$(".loading-container").hide(); 
						//var htmlText = marked.parse(result.output.text);
						var htmlText = marked.parse(result.output.choices[0].message.content); // 取第一个选项
						$('#responseContainer').html(htmlText);
						
					}
					
					if(result.output.choices[0].finish_reason == 'stop' ){
						eventSource.close();
						 //console.log("数据完成");
				
					}
				} catch (error) {
					console.log(error);
				}
				
			});

			eventSource.addEventListener('error', (error) => {
				console.error('EventSource failed:', error);
				eventSource.close();
				});

			eventSource.addEventListener("close", (event) => {
				//console.log("连接已关闭", JSON.stringify(event.data));
				eventSource.close();
				contentEnd = true;
				console.log((new Date().getTime()), 'answer end');
			});
			// 设置连接超时时间为 60 秒
			setTimeout(function() {
				eventSource.close();
				console.log('Connection timed out');
			}, 120000);
			



		
			});
	});
		 
    

})

autocomplete(document.getElementById("runnob-search-input"), suggestions);
//autocomplete(document.getElementById("s"), suggestions);
// 返回信息
var rn = "171861356816798185671884";
var ops_request_misc = "%7B%22request%5Fid%22%3A%22171861356816798185671884%22%2C%22scm%22%3A%2220140713.107711..%22%7D";
</script>
<!-- 底部 -->
<div id="footer" class="mar-t50">
   <div class="runoob-block">
    <div class="runoob cf">
     <dl>
      <dt>
       在线实例
      </dt>
      <dd>
       &middot;<a target="_blank" href="/html/html-examples.html">HTML 实例</a>
      </dd>
      <dd>
       &middot;<a target="_blank" href="/css/css-examples.html">CSS 实例</a>
      </dd>
      <dd>
       &middot;<a target="_blank" href="/js/js-examples.html">JavaScript 实例</a>
      </dd>
      <dd>
       &middot;<a target="_blank" href="/ajx/ajax-examples.html">Ajax 实例</a>
      </dd>
       <dd>
       &middot;<a target="_blank" href="/jquery/jquery-examples.html">jQuery 实例</a>
      </dd>
      <dd>
       &middot;<a target="_blank" href="/xml/xml-examples.html">XML 实例</a>
      </dd>
      <dd>
       &middot;<a target="_blank" href="/java/java-examples.html">Java 实例</a>
      </dd>
     
     </dl>
     <dl>
      <dt>
      字符集&工具
      </dt>
      <dd>
       &middot; <a target="_blank" href="/charsets/html-charsets.html">HTML 字符集设置</a>
      </dd>
      <dd>
       &middot; <a target="_blank" href="/tags/html-ascii.html">HTML ASCII 字符集</a>
      </dd>
     <dd>
       &middot; <a target="_blank" href="https://c.runoob.com/front-end/6939/">JS 混淆/加密</a>
      </dd> 
      <dd>
       &middot; <a target="_blank" href="https://c.runoob.com/front-end/6232/">PNG/JPEG 图片压缩</a>
      </dd>
      <dd>
       &middot; <a target="_blank" href="/tags/html-colorpicker.html">HTML 拾色器</a>
      </dd>
      <dd>
       &middot; <a target="_blank" href="//c.runoob.com/front-end/53">JSON 格式化工具</a>
      </dd>
      <dd>
       &middot; <a target="_blank" href="//c.runoob.com/front-end/6680/">随机数生成器</a>
      </dd>
     </dl>
     <dl>
      <dt>
       最新更新
      </dt>
                   <dd>
       &middot;
      <a href="http://www.runoob.com/cprogramming/c-function-timespec_get.html" title="C 库函数 &#8211; timespec_get">C 库函数 &#8211...</a>
      </dd>
              <dd>
       &middot;
      <a href="http://www.runoob.com/cprogramming/c-extern.html" title="C extern 关键字">C extern 关键字</a>
      </dd>
              <dd>
       &middot;
      <a href="http://www.runoob.com/cprogramming/c-function-sigwait.html" title="C 库函数 &#8211; sigwait()">C 库函数 &#8211...</a>
      </dd>
              <dd>
       &middot;
      <a href="http://www.runoob.com/cprogramming/c-function-strsignal.html" title="C 库函数 &#8211; strsignal()">C 库函数 &#8211...</a>
      </dd>
              <dd>
       &middot;
      <a href="http://www.runoob.com/cprogramming/c-function-psignal.html" title="C 库函数 &#8211; psignal()">C 库函数 &#8211...</a>
      </dd>
              <dd>
       &middot;
      <a href="http://www.runoob.com/cprogramming/c-function-alarm.html" title="C 库函数 &#8211; alarm()">C 库函数 &#8211...</a>
      </dd>
              <dd>
       &middot;
      <a href="http://www.runoob.com/cprogramming/c-function-sigismember.html" title="C 库函数 &#8211; sigismember()">C 库函数 &#8211...</a>
      </dd>
             </dl>
     <dl>
      <dt>
       站点信息
      </dt>
      <dd>
       &middot;
       <a target="_blank" href="mailto:admin@runoob.com" rel="external nofollow">意见反馈</a>
       </dd>
      <dd>
       &middot;
      <a target="_blank" href="/disclaimer">免责声明</a>
       </dd>
      <dd>
       &middot;
       <a target="_blank" href="/aboutus">关于我们</a>
       </dd>
      <dd>
       &middot;
      <a target="_blank" href="/archives">文章归档</a>
      </dd>
    
     </dl>
    
     <div class="search-share">
      <div class="app-download">
        <div>
         <strong>关注微信</strong>
        </div>
      </div>
      <div class="share">
      <img width="128" height="128" src="/wp-content/themes/runoob/assets/images/qrcode.png" />
       </div>
     </div>
     
    </div>
   </div>
   <div class="w-1000 copyright">
     Copyright &copy; 2013-2024    <strong><a href="//www.runoob.com/" target="_blank">菜鸟教程</a></strong>&nbsp;
    <strong><a href="//www.runoob.com/" target="_blank">runoob.com</a></strong> All Rights Reserved. 备案号：<a target="_blank" rel="nofollow" href="https://beian.miit.gov.cn/">闽ICP备15012807号-1</a>
   </div>
  </div>
  <div class="fixed-btn">
    <a class="go-top" href="javascript:void(0)" title="返回顶部"> <i class="fa fa-angle-up"></i></a>
    <a class="qrcode"  href="javascript:void(0)" title="关注我们"><i class="fa fa-qrcode"></i></a>
    <a class="writer" style="display:none" href="javascript:void(0)"   title="标记/收藏"><i class="fa fa-star" aria-hidden="true"></i></a>
    <!-- qrcode modal -->
    <div id="bottom-qrcode" class="modal panel-modal hide fade in">
      <h4>微信关注</h4>
      <div class="panel-body"><img alt="微信关注" width="128" height="128" src="/wp-content/themes/runoob/assets/images/qrcode.png"></div> 
    </div>
  </div>

<div style="display:none;">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-84264393-2"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-84264393-2');
</script>
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?3eec0b7da6548cf07db3bc477ea905ee";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
</div>

<script>
window.jsui={
    www: 'https://www.runoob.com',
    uri: 'https://www.runoob.com/wp-content/themes/runoob'
};
</script>

<script src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/clipboard.js/2.0.10/clipboard.min.js"></script>
<script src="https://static.jyshare.com/assets/libs/hl/run_prettify.js?v=1.168"></script>
<script src="/wp-content/themes/runoob/assets/js/main.min.js?v=1.168"></script>
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/marked/4.0.2/marked.min.js"></script>
</body>
</html>